<html>
<head>
<script>

function adding(val1, val2, val3)
{
var result;
var a=parseFloat(document.calc.val1.value);
var b=parseFloat(document.calc.val3.value);
var c=document.calc.val2.value;
switch (c)
{
	case '+':
		result=a+b;
		break;
	case '-':
		result=a-b;
		break;
	case '*':
		result=a*b;
		break;
	case '/':
		if(b!=0)
		{
			result=a/b;
		}
		else
		{
			alert("error: devide by zero");
		}
		break;
}
document.calc.is.value=result;
}
</script>
</head>
<body>

<FORM name="calc">

Ââåäèòå ÷èñëî<input name="val1" type="text" value=" " size="4">
<br><input name="val2" type="text" value="     " size="1">
<br>Ââåäèòå ÷èñëî<input name="val3" type="text" value=" " size="4">
<br>Введите знак<input type="button" value="  =  " onclick="adding(val1,val2,val3)">
<br>Ðåçóëüòàò<input name="is" type="text" value=" ">

</FORM>
</body>
</html>

